<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <select id="province">
        <option>---请选择---</option>
    </select>省
    <select id="city">
        <option>---请选择---</option>
    </select>市
</body>
<script src="js/jquery-3.3.1.min.js"></script>
<script>
        $.ajax({
            url:'/province/test1',
            type:'get',
            success:function (data) {
                for(let i =0;i<data.length;i++){
                    $("#province").append("<option value='" + data[i].id +"'>" + data[i].pname + "</option>");
                }
            }
        });

        $("#province").change(function () {
            let id = $(this).val();
            $.ajax({
                url:'/province/city',
                type:'post',
                data:'pid=' + id,
                success:function (data) {
                    //alert(id)
                    $("#city").html("<option>---请选择---</option>");
                    for(let i =0;i<data.length;i++){
                        $("#city").append("<option>" + data[i].cname + "</option>");
                    }
                }
            });
        })

</script>
</html>